<?php
declare (strict_types=1);

namespace app\admin\logic\promotion;

use app\admin\model\promotion\PromotionTuanData as PromotionTuanDataModel;

/**
 * Class PromotionTuanData
 *
 * @package app\admin\logic\promotion
 */
class PromotionTuanData extends PromotionTuanDataModel
{

    /**
     * 获取参团数据
     * Author: Martinsun <syh@sunyonghong.com>
     * Date: 2021/4/24
     *
     * @param int $tuanId
     * @param     $status
     * @return \think\Collection
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\DbException
     * @throws \think\db\exception\ModelNotFoundException
     */
    public function getTuanDatas(int $tuanId, $status): \think\Collection
    {
        return $this->with(['user'])
            ->where('tuan_id', $tuanId)
            ->where('status', 'in', $status)
            ->select();
    }
}